<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!-- 定义项目路径   url标签可以  -->
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>伊翔分销平台-采购商审核</title>

    <style type="text/css">
        *{
            margin:0;
            padding:0;
        }
        img{
        	border:0;
        }
        .formBox{
        	width:280px;
        	min-height:800px;
        	margin:0 auto;
        	font-size:12px;
        }
        .formBox p{
        	width:280px;
        	min-height:25px;
        	float:right;
        	line-height:25px;
        	margin:0 auto;
        	margin-top:15px;
        	clear:both;
        }
        .formBox .buttonBox{
        	margin-top:100px;
        }
         .formBox span{
        	display:block; 
        	float:left;  
        	margin-left:15px;
        	width:170px;
        	min-height:25px;
        }
        .formBox p .newWidth{
        	width:60px;
        	height:25px;
        } 
        .formBox p .licenseImg{
        	width:80px;
        }
        .grey{
        	color:#9ca4a7;
        }
        .u_logo{margin: 12px 0 24px;}
        .u_logo a{}
        .u_logo a img{ border:0;}
        .mod-breadBox{
            width:100%;
            height:60px;
            background: #34c0e3;
        }
        .mod-bread {width:1300px;height: 60px;margin:0 auto;color:white;line-height:60px;}
        .mod-bread .bread-left {float: left;font-size: 14px;font-weight: bold;height: 60px;text-align: right;width: 137px;}
        .mod-bread .bread-right {float: right;height: 60px;padding-right: 20px;}
        .orange{
            color:#f3f820;
        }
        /*内容区*/
        .user_form{
            width:400px;
            min-height:100px;
            margin:0 auto;
            font-size:12px;
            margin-top:50px;
        }
    </style>
    <link href="${ctx }/jslib/layui/css/layui.css" rel="stylesheet" type="text/css" />
    <!-- 引入jQuery -->
    <script src="${ctx}/jslib/jquery-1.8.3.js" type="text/javascript" charset="utf-8"></script>
    <!-- 引入layer -->
    <script src="${ctx}/jslib/layer/layer.js" type="text/javascript" charset="utf-8"></script>
    <script src="${ctx }/jslib/jquery.form.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            layer.load();
            $.ajax({
                type:'post',
                url:'${ctx}/user/selectInfoById/${id}',
                dataType:'json',
                success:function(data){
                    layer.closeAll();
                    $("#username").html(data.username);
                    $("#nickname").html(data.nickname);
                    $("#company").html(data.company);
                    $("#address").html(data.prov+data.city);
                    $("#location").html(data.location);
                    $("#contacts").html(data.contacts);
                    $("#mobile").html(data.mobile);
                    $("#telphone").html(data.telphone);
                    $("#mail").html(data.mail);
                    $("#bankName").html(data.bankName);
                    $("#bankCard").html(data.bankCard);
                    $("#bankUser").html(data.bankUser);
                    $("#zzfile").attr("src",data.zzPath);
                    $("#showfile").attr("src",data.zzPath);
                },
                error:function(msg){
                    layer.closeAll();
                    layer.alert("请检查您的网络连接，然后重试！");
                }
            });
        });

        function audit(state){
            var remark = $("#remark").val();
            $.ajax({
                type:'post',
                url:'${ctx}/user/audit/${id}?state='+state,
                data:{remark:remark},
                dataType:'json',
                success:function(data){
                    layer.closeAll();
                    if(data.success){
                        layer.alert(data.msg,{skin:'layui-layer-lan',title: ['系统提示', 'background-color:#00B2EE; color:#fff;'],closeBtn: 0}, function(index){
                            window.location.href="${ctx}/np/buyerList?t="+Math.random();
                            layer.close(index);
                        });
                    }
                    else{
                        layer.alert(data.msg);
                    }
                },
                error:function(msg){
                    layer.closeAll();
                    layer.alert("请检查您的网络连接，然后重试！");
                }
            });
        }
        function showPic(){
            layer.open({
                type: 1,
                title: false,
                closeBtn: 1,
                skin: 'layui-layer-nobg', //没有背景色
                shadeClose: true,
                content:$('#img').html()
            });
        }
    </script>
</head>

<body style="width:100%;background:white;">
<jsp:include page="../head.jsp"></jsp:include>
<div class="formBox">
        <p>
            <span id="label_username" class="newWidth" for="username">用户名</span>
            <span id="username" class="grey"></span>
        </p>

        <p>
            <span id="label_nickname" class="newWidth" for="nickname">昵称</span>
            <span id="nickname" class="grey"></span>
        </p>

        <p>
            <span id="label_company" class="newWidth" for="company">公司名称</span>
            <span id="company" class="grey"></span>
        </p>

        <p id="city_3">
            <span id="label_address" class="newWidth" for="address">公司位置</span>
            <span id="address" class="grey"></span>
        </p>

        <p>
            <span id="label_location" class="newWidth" for="location">具体地址</span>
            <span id="location" class="grey"></span>
        </p>

        <p>
            <span id="label_contacts" class="newWidth" for="contacts">联系人</span>
            <span id="contacts" class="grey"></span>
        </p>


        <p>
            <span id="label_mobile" class="newWidth" for="mobile">手机</span>
            <span id="mobile" class="grey"></span>
        </p>

        <p>
            <span id="label_telphone" class="newWidth" for="telphone">公司电话</span>
            <span id="telphone" class="grey"></span>
        </p>

        <p>
            <span id="label_mail" class="newWidth" for="mail">邮箱</span>
            <span id="mail" class="grey"></span>
        </p>

        <p>
            <span id="label_bankName" class="newWidth" for="bankName">开户银行</span>
            <span id="bankName" class="grey"></span>
        </p>

        <p>
            <span id="label_bankCard" class="newWidth" for="bankCard">卡号</span>
            <span id="bankCard" class="grey"></span>
        </p>

        <p>
            <span id="label_bankUser" class="newWidth" for="bankUser">持卡人</span>
            <span id="bankUser" class="grey"></span>
        </p>

        <p class="licenseImg">
            <span id="label_zzfile">营业执照图片</label>
            <img id="zzfile" height="100px"  onclick="showPic()">
            <span id="img" style="display: none"><img id="showfile" ></span>
        </p>
        <p>
            <span id="label_remark" for="remark" class="newWidth">备注</span>
           <textarea rows="5" cols="40" name="remark" class="grey" id="remark"></textarea>
        </p>
        <p class="buttonBox">
            <span class="add_minus" style="margin-left:30px;width:60px;" onclick="audit(0)">通过</span>
            <span class="backOne" style="width:60px;margin-left:50px;" onclick="audit(2)">不通过</span>
        </p>
        
</div>
<div style="height:200px;width:1300px;"></div>
<jsp:include page="../footer.jsp"/>
</body>
</html>
